package edu.ynu.se.xiecheng.achitectureclass.device.entity;

import edu.ynu.se.xiecheng.achitectureclass.common.entity.LogicEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.time.LocalDateTime;

@Entity
@Table(name = "device_data")
@Getter
@Setter
public class DeviceData extends LogicEntity {
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "device_id")
    private Device device;
    
    @Column(nullable = false)
    private Double value;
    
    @Column(nullable = false)
    private LocalDateTime collectionTime;
    
    @Column(length = 1000)
    private String rawData;  // 原始数据，可能是JSON格式
} 